﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.SqlClient;
using System.Globalization;
using System.Web;
using Single_SignOn.ResX;
using System.Web.Mvc;
using System.Web.Security;
using System.Resources;

namespace Single_SignOn.Areas.Web.Models
{
    
    public class LoginModels 
    {
        public LoginModels()
        {
            IsInitialDisplay = true;
            /*HttpCookie cookies = new HttpCookie(string.Format("{0}{1}", WebConfig.Cookies,Username));
            if (cookies.HasKeys)
            {
                Username = cookies.Name;
                Password = cookies.Value;
                RememberMe = true;
            }*/

            Username = "";
            Password = "";
            RememberMe = false;
        }

        public bool IsInitialDisplay { get; set; }

        [Required(ErrorMessage = "", ErrorMessageResourceName = "UsernameRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "Username", ResourceType = typeof(Resources.Resource))]
        [StringLength(20)]
        public string Username { get; set; }


        [Required(ErrorMessage = "", ErrorMessageResourceName = "PasswordRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "Password", ResourceType = typeof(Resources.Resource))]
        [DataType(DataType.Password)]
        [StringLength(100       
            , MinimumLength = 1)]
        public string Password { get; set; }

        [Display(Name = "RememberMe", ResourceType = typeof(Resources.Resource))]
        public bool RememberMe { get; set; }

    }
}